﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BSCMFF.Core.DataAccessLayer;

namespace BSCMFF.Web.Pages.Evaluation_Setup
{
    public partial class EvaluationFillingMode : System.Web.UI.Page
    {
        private BSCMFF.Core.DataAccessLayer.Evaluation _eval;// = new Evaluation();

        /*public BSCMFF.Core.DataAccessLayer.Evaluation Evalut
        {
            get
            {
                if (_eval == null)
                {
                    _eval = new BSCMFF.Core.DataAccessLayer.Evaluation();
                    int tempID = 0;
                    Int32.TryParse(LabelID.Text, out tempID);
                    _eval.ID = tempID;
                    _eval.Name = RadTextBoxName.Text;
                    _eval.Description = RadTextBoxDescription.Text;
                    if (RadDatePickerStartDate.Text != "")
                    {
                        _eval.StartDate = DateTime.Parse(RadDatePickerStartDate.Text);
                    }
                    if (RadDatePickerEndDate.Text != "")
                    {
                        _eval.EndDate = DateTime.Parse(RadDatePickerEndDate.Text);
                    }
                    //_eval.Repetition = CheckBoxRepetition.Checked;
                    return _eval;
                }
                else
                {
                    return _eval;
                }
            }
            set
            {
                _eval = value;
            }
        }*/

        protected void Page_Load(object sender, EventArgs e)
        {

            if (Request.QueryString["EvaluationID"] == null)
            {
                Response.Redirect("EvaluationFillingMode.aspx?EvaluationID=19");


            }
            int evalID = Convert.ToInt32(Request.QueryString["EvaluationID"]);

            BSCEntities context = new BSCEntities();
            BSCMFF.Core.DataAccessLayer.Evaluation selectedEval = (from ev in context.Evaluations
                                       where ev.ID == evalID
                                       select ev).Single();
            //ed.Evalut = selectedEval;
            //ed.DataBind();
            ed.Evalut = selectedEval;
            //this.Evalut = selectedEval;
            this.DataBind();
        }
    }
}